<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=request.getParameter("id")%>場地詳細資料</title>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/>
<jsp:useBean id="p_state" scope="page" class="bean.StateBean"/>
<jsp:useBean id="pclass" scope="page" class="myclass.P_Class"/>
<% 

	  String sql="select * from PLACE WHERE P_ID='"+request.getParameter("id")+"'";
	  ResultSet rs=mydb.executeQuery(sql);
	  rs.next();
	  sql="select * from PLACE_CLASS WHERE PC_ID='"+rs.getString("P_Class")+"'";
      ResultSet rs2=pclass.getPcName(sql);
      rs2.next();
%>
    <table width="500" border="1" bordercolor="#999999" align="center">
          <tr>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">場地編號</span></td>
            <td width="274"><%=rs.getString("P_ID")%></td>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">場地類別</span></td>
            <td width="274"><%=rs2.getString("PC_NAME")%></td>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">地點名稱</span></td>
            <td width="274"><%=rs.getString("P_NAME")%></td>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">狀態</span></td>
            <td width="274"><%=p_state.getPState(rs.getString("P_STATE"))%></td>
          </tr>
          <tr>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">場地描述</span></td>
            <td colspan="7">
            	<table width="200" border="0">
  				<tr>
    				<td>可容納人數</td>
    				<td><%=rs.getString("PERSON")%></td>
  				</tr>
  				<tr>
    				<td>是否有空調</td>
    				<td><%=rs.getString("AIR") %></td>
 				</tr>
  				<tr>
    				<td>隔音效果</td>
    				<td><%=rs.getString("DEAFENING") %></td>
  				</tr>
  				<tr>
    				<td>音響設備</td>
    				<td><%=rs.getString("ACOUSTICS") %></td>
 				</tr>
  				<tr>
    				<td>麥克風</td>
    				<td><%= rs.getString("MIR")%></td>
  				</tr>
  				<tr>
    				<td>投影屏幕</td>
    				<td><%=rs.getString("SCREEN") %></td>
  				</tr>
  				<tr>
    				<td>投影機</td>
    				<td><%=rs.getString("PROJECTOR") %></td>
  				</tr>
  				<tr>
    				<td>燈光效果</td>
    				<td><%=rs.getString("LIGHT") %></td>
  				</tr>
  				<tr>
    				<td>無線上網</td>
    				<td><%=rs.getString("WIRELESS") %></td>
  				</tr>
  				<tr>
    				<td>LCD跑馬燈</td>
    				<td><%=rs.getString("LCD") %></td>
 				</tr>
			</table>
            
            </td>
          </tr>
          <tr>
            <td width="91" align="left" bgcolor="#9999CC" scope="row"><span class="style46">備註</span></td>
            <td colspan="7"><%=rs.getString("PS")%></td>
          </tr>          
	  </table>

<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
	  
</body>
</html>